import requests
# 2. 获取二进制的数据(图片)  resp.content   15:40
url = "http://pic1.win4000.com/wallpaper/6/58f065330709a.jpg"
resp = requests.get(url)
fwb = open("/opt/mypic.jpg", mode="wb")
fwb.write(resp.content)
fwb.close()  # 查看下载结果   eog /opt/mypic.jpg
# 1. 获取文本信息 resp.text
# url = "http://www.163.com"
# # requests.get的返回值：是服务端给客户端的响应(response)
# resp = requests.get(url)  # get请求：用于对数据的获取或者查询，相当于读请求
# print(resp.text)  # 查看文本信息
